﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Master/Site.master" AutoEventWireup="false"
    MaintainScrollPositionOnPostback="true" CodeFile="Recipients1.aspx.vb" Inherits="private_secure_members_manage_MyLists" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 737px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        Manage My List(s)</h2>
    <h3>
        Use this page to Manage the List(s) of people you intend to communicate with.
    </h3>
    &nbsp;
    <table id="table1" class="style1">
        <tr>
            <td class="style2">
                A List is a named group of people you will communicate with (via email or Text)<br />
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top" class="style2">
                Your Organisation(s)&nbsp;<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
                    DataSourceID="MyEntityODS" DataTextField="Name" DataValueField="ID" Width="209px">
                </asp:DropDownList>
                &nbsp;
                <asp:ObjectDataSource ID="MyEntityODS" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_GetPersonEntityListByPersonIdTableAdapter">
                    <SelectParameters>
                        <asp:Parameter DbType="Guid" Name="UserId" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="top" class="style2">
                Below are your List(s) for the organisation/entity/club/group selected above.
            </td>
            <td rowspan="5" valign="top">
                &nbsp; &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2" valign="top">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    DeleteCommand="usp_TargetListDelete" DeleteCommandType="StoredProcedure" InsertCommand="usp_TargetListInsert"
                    InsertCommandType="StoredProcedure" SelectCommand="usp_TargetListSelectByEntityId"
                    SelectCommandType="StoredProcedure" UpdateCommand="usp_TargetListUpdate" UpdateCommandType="StoredProcedure">
                    <DeleteParameters>
                        <asp:ControlParameter ControlID="DropDownList2" Name="ID" PropertyName="SelectedValue"
                            Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="MsgRef" Type="String" />
                        <asp:Parameter Name="BillingRef" Type="String" />
                        <asp:Parameter Name="ListTypeId" Type="Byte" />
                        <asp:Parameter Name="Note" Type="String" />
                        <asp:Parameter Name="SingleUse" Type="Boolean" />
                        <asp:Parameter Name="DateCreated" Type="DateTime" />
                        <asp:Parameter Name="AutoDiscarded" Type="Boolean" />
                        <asp:Parameter Name="DateDiscarded" Type="Boolean" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList1" Name="EntityID" PropertyName="SelectedValue"
                            Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="ID" Type="Int32" />
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="MsgRef" Type="String" />
                        <asp:Parameter Name="BillingRef" Type="String" />
                        <asp:Parameter Name="ListTypeId" Type="Byte" />
                        <asp:Parameter Name="Note" Type="String" />
                        <asp:Parameter Name="SingleUse" Type="Boolean" />
                        <asp:Parameter Name="DateCreated" Type="DateTime" />
                        <asp:Parameter Name="AutoDiscarded" Type="Boolean" />
                        <asp:Parameter Name="DateDiscarded" Type="Boolean" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" DeleteMethod="Delete"
                    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
                    TypeName="LogginsLogDSTableAdapters.usp_TargetListRecipient_ExpTableAdapter"
                    UpdateMethod="Update">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="TargetListId" Type="Int32" />
                        <asp:Parameter Name="RecipientId" Type="Int32" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="TargetListId" Type="Int32" />
                        <asp:Parameter Name="RecipientId" Type="Int32" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_RecipientsTableAdapter"
                    DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="CustomRefId" Type="String" />
                        <asp:Parameter Name="FirstName" Type="String" />
                        <asp:Parameter Name="LastName" Type="String" />
                        <asp:Parameter Name="HomeEmailAddress" Type="String" />
                        <asp:Parameter Name="WorkEmailAddress" Type="String" />
                        <asp:Parameter Name="MobileNo" Type="String" />
                        <asp:Parameter Name="DateAddedToList" Type="DateTime" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                        <asp:Parameter Direction="InputOutput" Name="NewRecipientId" Type="Object" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:Parameter Name="TargetListid" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="CustomRefId" Type="String" />
                        <asp:Parameter Name="FirstName" Type="String" />
                        <asp:Parameter Name="LastName" Type="String" />
                        <asp:Parameter Name="HomeEmailAddress" Type="String" />
                        <asp:Parameter Name="WorkEmailAddress" Type="String" />
                        <asp:Parameter Name="MobileNo" Type="String" />
                        <asp:Parameter Name="DateAddedToList" Type="DateTime" />
                        <asp:Parameter Name="Active" Type="Boolean" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
                <asp:DropDownList ID="DropDownList2" runat="server" CausesValidation="false" DataSourceID="SqlDataSource1"
                    DataTextField="Name" DataValueField="ID" AutoPostBack="True">
                </asp:DropDownList>
                <asp:Label ID="Label25" runat="server" Text="" Visible="False"></asp:Label>
                <asp:Button ID="btnDDLInsert" runat="server" Text="Insert" CausesValidation="false" />
                <asp:Button ID="btnDDLUpdate" runat="server" Text="Update" Visible="false" CausesValidation="false" />
                <asp:Button ID="btnDDLDelete" runat="server" Text="Delete" CausesValidation="false"
                    Visible="false" />
                <asp:ConfirmButtonExtender ID="btnDDLDelete_ConfirmButtonExtender" runat="server"
                    ConfirmText="Delete selected list ?" Enabled="True" TargetControlID="btnDDLDelete">
                </asp:ConfirmButtonExtender>
                <asp:Button ID="Button3" runat="server" Text="Add recipient" CausesValidation="false"
                    Visible="false" />
                <asp:Label ID="Label19" runat="server" Text=""></asp:Label>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2">
                Recipients
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
                    <ContentTemplate>
                        <asp:GridView ID="GridView2" runat="server" AllowSorting="True" 
                            AutoGenerateColumns="False" CausesValidation="false" DataKeyNames="Id" 
                            DataSourceID="ObjectDataSource1">
                            <Columns>
                                <asp:CommandField ShowSelectButton="True" />
                                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                                    ReadOnly="True" SortExpression="Id" />
                                <asp:BoundField DataField="CustomRefId" HeaderText="CustomRefId" 
                                    SortExpression="CustomRefId" />
                                <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                                    SortExpression="FirstName" />
                                <asp:BoundField DataField="LastName" HeaderText="LastName" 
                                    SortExpression="LastName" />
                                <asp:BoundField DataField="HomeEmailAddress" HeaderText="HomeEmailAddress" 
                                    SortExpression="HomeEmailAddress" />
                                <asp:BoundField DataField="WorkEmailAddress" HeaderText="WorkEmailAddress" 
                                    SortExpression="WorkEmailAddress" />
                                <asp:BoundField DataField="MobileNo" HeaderText="MobileNo" 
                                    SortExpression="MobileNo" />
                                <asp:BoundField DataField="DateAddedToList" HeaderText="DateAddedToList" 
                                    SortExpression="DateAddedToList" />
                                <asp:CheckBoxField DataField="IsAdult" HeaderText="IsAdult" 
                                    SortExpression="IsAdult" />
                                <asp:BoundField DataField="Gender" HeaderText="Gender" 
                                    SortExpression="Gender" />
                                <asp:BoundField DataField="NI_Number" HeaderText="NI_Number" 
                                    SortExpression="NI_Number" />
                                <asp:BoundField DataField="SS_Number" HeaderText="SS_Number" 
                                    SortExpression="SS_Number" />
                                <asp:BoundField DataField="BirthMonth" HeaderText="BirthMonth" 
                                    SortExpression="BirthMonth" />
                                <asp:BoundField DataField="BirthDay" HeaderText="BirthDay" 
                                    SortExpression="BirthDay" />
                                <asp:BoundField DataField="BirthYear" HeaderText="BirthYear" 
                                    SortExpression="BirthYear" />
                                <asp:BoundField DataField="PostCode" HeaderText="PostCode" 
                                    SortExpression="PostCode" />
                                <asp:BoundField DataField="HouseNo" HeaderText="HouseNo" 
                                    SortExpression="HouseNo" />
                                <asp:BoundField DataField="OccupationNote" HeaderText="OccupationNote" 
                                    SortExpression="OccupationNote" />
                                <asp:CheckBoxField DataField="IsLocal" HeaderText="IsLocal" 
                                    SortExpression="IsLocal" />
                            </Columns>
                        </asp:GridView>
                    </ContentTemplate>

                </asp:UpdatePanel>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style2" valign="top">
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="TempTableAdapters.DataTable1TableAdapter">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList2" Name="TargetListId" PropertyName="SelectedValue"
                            Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    <%--        <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">
    --%>
    <asp:Panel ID="pnlRegistrationSuccess" runat="server" Style="display: none" CssClass="modalPopup">
        <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
        --%>
        <asp:Button ID="btnCancel" runat="server" CausesValidation="false" Text="X" Style="float: right;
            background-color: #FF0000;" />
        <h2>
            <asp:Label ID="lblAction" runat="server" Text="PopUp Heading2"></asp:Label></h2>
        <table style="width: 100%;">
            <tr>
                <td valign="top">
                    Name of List:
                </td>
                <td valign="top">
                    <asp:TextBox ID="txtName" runat="server" Width="160px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Enter the Name of the list."
                        ControlToValidate="txtName"></asp:RequiredFieldValidator>
                </td>
                <td rowspan="4" valign="top">
                </td>
            </tr>
            <tr>
                <td valign="top">
                    Type of List:
                </td>
                <td>
                    <asp:DropDownList ID="ddllkpListType" runat="server" DataSourceID="lkpListTypeODS"
                        DataTextField="Name" DataValueField="Id">
                    </asp:DropDownList>
                    <asp:ObjectDataSource ID="lkpListTypeODS" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
                        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="LogginsLogDSTableAdapters.usp_lkp_ListTypeTableAdapter"
                        UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="Id" Type="Byte" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:Parameter Name="Id" Type="Byte" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="Id" Type="Byte" />
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                        </UpdateParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    Your Note:
                </td>
                <td valign="top">
                    <asp:TextBox ID="txtNote" runat="server" Height="113px" TextMode="MultiLine" Width="396px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td valign="top">
                    <asp:Button ID="btnInsert" runat="server" Text="Insert" />
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" />
                    <asp:Label ID="lblInfo" runat="server" Text=""></asp:Label>
                    <asp:HiddenField ID="hdfSelectedId" runat="server" />
                    <asp:ObjectDataSource ID="InsertTargetListODS" runat="server" DeleteMethod="Delete"
                        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
                        TypeName="LogginsLogDSTableAdapters.usp_TargetListTableAdapter" UpdateMethod="Update">
                        <DeleteParameters>
                            <asp:Parameter Name="ID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="EntityId" Type="Int32" />
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="MsgRef" Type="String" />
                            <asp:Parameter Name="BillingRef" Type="String" />
                            <asp:Parameter Name="ListTypeId" Type="Byte" />
                            <asp:Parameter Name="Note" Type="String" />
                            <asp:Parameter Name="SingleUse" Type="Boolean" />
                            <asp:Parameter Name="DateCreated" Type="DateTime" />
                            <asp:Parameter Name="AutoDiscarded" Type="Boolean" />
                            <asp:Parameter Name="DateDiscarded" Type="Boolean" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                            <asp:Parameter Direction="InputOutput" Name="TargetListId" Type="Object" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:Parameter Name="EntityID" Type="Int32" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ID" Type="Int32" />
                            <asp:Parameter Name="EntityId" Type="Int32" />
                            <asp:Parameter Name="Name" Type="String" />
                            <asp:Parameter Name="MsgRef" Type="String" />
                            <asp:Parameter Name="BillingRef" Type="String" />
                            <asp:Parameter Name="ListTypeId" Type="Byte" />
                            <asp:Parameter Name="Note" Type="String" />
                            <asp:Parameter Name="SingleUse" Type="Boolean" />
                            <asp:Parameter Name="DateCreated" Type="DateTime" />
                            <asp:Parameter Name="AutoDiscarded" Type="Boolean" />
                            <asp:Parameter Name="DateDiscarded" Type="Boolean" />
                            <asp:Parameter Name="Active" Type="Boolean" />
                        </UpdateParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
        <asp:Button ID="btnRegistrationSuccess" runat="server" Text="Button" Style="display: none;" />
        <asp:ModalPopupExtender ID="InsertPopupExtender" runat="server" PopupControlID="pnlRegistrationSuccess"
            DynamicServicePath="" Enabled="True" TargetControlID="btnRegistrationSuccess"
            BackgroundCssClass="modalBackground" DropShadow="true">
        </asp:ModalPopupExtender>
    </asp:Panel>
    <asp:Panel ID="pnlSecondPopoUp" runat="server" Style="display: none" CssClass="modalPopup">
        <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
        --%>
        <asp:Button ID="btnCloseSecondPopUp" runat="server" CausesValidation="false" Text="X"
            Style="float: right; background-color: #FF0000;" />
        <h2>
            <asp:Label ID="Label18" runat="server" Text="PopUp Heading1"></asp:Label></h2>
        <table style="width: 100%;">
            <tr>
                <td valign="top">
                    <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" Width="572px">
                        <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
                            <ContentTemplate>
                                <table style="width:100%;">
                                    <tr>
                                        <td valign="top">
                                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                            
                                            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                                                CausesValidation="false" DataKeyNames="Id" DefaultMode="Insert" Height="50px" 
                                                Width="125px">
                                                <Fields>
                                                    <asp:TemplateField HeaderText="Id" InsertVisible="False" SortExpression="Id">
                                                        <EditItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="CustomRefId" SortExpression="CustomRefId">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CustomRefId") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CustomRefId") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("CustomRefId") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="FirstName" SortExpression="FirstName">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="LastName" SortExpression="LastName">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("LastName") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="HomeEmailAddress" 
                                                        SortExpression="HomeEmailAddress">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox4" runat="server" 
                                                                Text='<%# Bind("HomeEmailAddress") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox4" runat="server" 
                                                                Text='<%# Bind("HomeEmailAddress") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("HomeEmailAddress") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="WorkEmailAddress" 
                                                        SortExpression="WorkEmailAddress">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox5" runat="server" 
                                                                Text='<%# Bind("WorkEmailAddress") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox5" runat="server" 
                                                                Text='<%# Bind("WorkEmailAddress") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("WorkEmailAddress") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="MobileNo" SortExpression="MobileNo">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("MobileNo") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("MobileNo") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("MobileNo") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="DateAddedToList" 
                                                        SortExpression="DateAddedToList">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("DateAddedToList") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("DateAddedToList") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("DateAddedToList") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="IsAdult" SortExpression="IsAdult">
                                                        <EditItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsAdult") %>' />
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsAdult") %>' />
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsAdult") %>' 
                                                                Enabled="false" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Gender" SortExpression="Gender">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Gender") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Gender") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label9" runat="server" Text='<%# Bind("Gender") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="NI_Number" SortExpression="NI_Number">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("NI_Number") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("NI_Number") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("NI_Number") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="SS_Number" SortExpression="SS_Number">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("SS_Number") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("SS_Number") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label11" runat="server" Text='<%# Bind("SS_Number") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="BirthMonth" SortExpression="BirthMonth">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("BirthMonth") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("BirthMonth") %>'></asp:TextBox>
                                                            <asp:MaskedEditExtender ID="TextBox11_MaskedEditExtender" runat="server" 
                                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                                Mask="99" TargetControlID="TextBox11">
                                                            </asp:MaskedEditExtender>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label12" runat="server" Text='<%# Bind("BirthMonth") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="BirthDay" SortExpression="BirthDay">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("BirthDay") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("BirthDay") %>'></asp:TextBox>
                                                            <asp:MaskedEditExtender ID="TextBox12_MaskedEditExtender" runat="server" 
                                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                                Mask="99" TargetControlID="TextBox12">
                                                            </asp:MaskedEditExtender>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label13" runat="server" Text='<%# Bind("BirthDay") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="BirthYear" SortExpression="BirthYear">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("BirthYear") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("BirthYear") %>'></asp:TextBox>
                                                            <asp:MaskedEditExtender ID="TextBox13_MaskedEditExtender" runat="server" 
                                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                                Mask="9999" TargetControlID="TextBox13">
                                                            </asp:MaskedEditExtender>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label14" runat="server" Text='<%# Bind("BirthYear") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="PostCode" SortExpression="PostCode">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("PostCode") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("PostCode") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label15" runat="server" Text='<%# Bind("PostCode") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="HouseNo" SortExpression="HouseNo">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("HouseNo") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("HouseNo") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label16" runat="server" Text='<%# Bind("HouseNo") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="OccupationNote" SortExpression="OccupationNote">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("OccupationNote") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("OccupationNote") %>'></asp:TextBox>
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label17" runat="server" Text='<%# Bind("OccupationNote") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="IsLocal" SortExpression="IsLocal">
                                                        <EditItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("IsLocal") %>' />
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("IsLocal") %>' />
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("IsLocal") %>' 
                                                                Enabled="false" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Fields>
                                            </asp:DetailsView>
                                                                                    <asp:Button ID="Button4" runat="server" 
                                                    CausesValidation="False" Text="Insert" />
                                                <asp:Button ID="Button8" runat="server" CausesValidation="False" Text="Save" />
                                                <asp:Button ID="Button9" runat="server" CausesValidation="False" 
                                                    Text="Delete" />
                                                <asp:ConfirmButtonExtender ID="Button9_ConfirmButtonExtender" runat="server" 
                                                    ConfirmText="Delete recipient ?" Enabled="True" TargetControlID="Button9">
                                                </asp:ConfirmButtonExtender>
                                                                                    </ContentTemplate>
                                            </asp:UpdatePanel>

                                        
                                        </td>
                                        <td rowspan="3" valign="top">
                                            <asp:SqlDataSource ID="Sqllkp_TgtLstClmnLst_DDL" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                                                SelectCommand="usp_GetTargetListColumnList_incl_excl" 
                                                SelectCommandType="StoredProcedure">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="DropDownList2" Name="TargetListId" 
                                                        PropertyName="SelectedValue" Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>

                                            <asp:Label ID="Label23" runat="server"></asp:Label>
                                            <asp:Panel ID="pnlSelectedColumns" runat="server" Visible="False">
                                                                                        <asp:UpdatePanel ID="updSaveColumns" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>

                                                <strong>Columns for your List</strong>
                                                <asp:GridView ID="grdSelectedFields" runat="server" AutoGenerateColumns="False" 
                                                    DataKeyNames="ColumnName" DataSourceID="Sqllkp_TgtLstClmnLst_DDL">
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Column Name" SortExpression="ColumnName" 
                                                            Visible="False">
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="TextBox17" runat="server" Text='<%# Bind("ColumnName") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                            <ItemTemplate>
                                                                <asp:Label ID="Label24" runat="server" Text='<%# Bind("ColumnName") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Selected" SortExpression="Selected">
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="TextBox18" runat="server" Text='<%# Bind("Selected") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="chkboxFilled" runat="server" 
                                                                    Checked='<%# Bind("Selected") %>' Text='<%# Eval("ColumnName") %>' />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                </asp:GridView>
                                                        <asp:Button ID="btnInsertCol" runat="server" CausesValidation="false" 
                                                            Text="Save" />
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </asp:Panel>
                                        </td>
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;</td>
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;</td>
                                        <td>
                                            &nbsp;</td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:TabPanel>
                        <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
                            <ContentTemplate>
                                <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="0" Selected="True">Copy</asp:ListItem>
                                    <asp:ListItem Value="1">Move</asp:ListItem>
                                </asp:RadioButtonList>
                                From list
                                <asp:Label ID="Label21" runat="server"></asp:Label>
                                &nbsp;to list
                                <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="SqlDataSource1"
                                    DataTextField="Name" DataValueField="ID">
                                </asp:DropDownList>
                                <br />
                                <asp:Button ID="Button10" runat="server" Text="Save" CausesValidation="False" />
                                <br />
                                <asp:Label ID="Label22" runat="server"></asp:Label>
                                <asp:HiddenField ID="HiddenField1" runat="server" />
                                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                                    DeleteCommand="usp_TargetListDelete" DeleteCommandType="StoredProcedure" InsertCommand="usp_TargetListInsert"
                                    InsertCommandType="StoredProcedure" SelectCommand="usp_TargetListSelectByEntityId"
                                    SelectCommandType="StoredProcedure" UpdateCommand="usp_TargetListUpdate" UpdateCommandType="StoredProcedure">
                                    <DeleteParameters>
                                        <asp:ControlParameter ControlID="DropDownList2" Name="ID" PropertyName="SelectedValue"
                                            Type="Int32" />
                                    </DeleteParameters>
                                    <InsertParameters>
                                        <asp:Parameter Name="EntityId" Type="Int32" />
                                        <asp:Parameter Name="Name" Type="String" />
                                        <asp:Parameter Name="MsgRef" Type="String" />
                                        <asp:Parameter Name="BillingRef" Type="String" />
                                        <asp:Parameter Name="ListTypeId" Type="Byte" />
                                        <asp:Parameter Name="Note" Type="String" />
                                        <asp:Parameter Name="SingleUse" Type="Boolean" />
                                        <asp:Parameter Name="DateCreated" Type="DateTime" />
                                        <asp:Parameter Name="AutoDiscarded" Type="Boolean" />
                                        <asp:Parameter Name="DateDiscarded" Type="Boolean" />
                                        <asp:Parameter Name="Active" Type="Boolean" />
                                    </InsertParameters>
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="DropDownList1" Name="EntityID" PropertyName="SelectedValue"
                                            Type="Int32" />
                                    </SelectParameters>
                                    <UpdateParameters>
                                        <asp:Parameter Name="ID" Type="Int32" />
                                        <asp:Parameter Name="EntityId" Type="Int32" />
                                        <asp:Parameter Name="Name" Type="String" />
                                        <asp:Parameter Name="MsgRef" Type="String" />
                                        <asp:Parameter Name="BillingRef" Type="String" />
                                        <asp:Parameter Name="ListTypeId" Type="Byte" />
                                        <asp:Parameter Name="Note" Type="String" />
                                        <asp:Parameter Name="SingleUse" Type="Boolean" />
                                        <asp:Parameter Name="DateCreated" Type="DateTime" />
                                        <asp:Parameter Name="AutoDiscarded" Type="Boolean" />
                                        <asp:Parameter Name="DateDiscarded" Type="Boolean" />
                                        <asp:Parameter Name="Active" Type="Boolean" />
                                    </UpdateParameters>
                                </asp:SqlDataSource>
                                <asp:ObjectDataSource ID="ObjectDataSource5" runat="server" DeleteMethod="Delete"
                                    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
                                    TypeName="LogginsLogDSTableAdapters.usp_TargetListRecipient_ExpTableAdapter"
                                    UpdateMethod="Update">
                                    <DeleteParameters>
                                        <asp:Parameter Name="Id" Type="Int32" />
                                    </DeleteParameters>
                                    <InsertParameters>
                                        <asp:Parameter Name="TargetListId" Type="Int32" />
                                        <asp:Parameter Name="RecipientId" Type="Int32" />
                                        <asp:Parameter Name="Active" Type="Boolean" />
                                    </InsertParameters>
                                    <SelectParameters>
                                        <asp:Parameter Name="Id" Type="Int32" />
                                    </SelectParameters>
                                    <UpdateParameters>
                                        <asp:Parameter Name="Id" Type="Int32" />
                                        <asp:Parameter Name="TargetListId" Type="Int32" />
                                        <asp:Parameter Name="RecipientId" Type="Int32" />
                                        <asp:Parameter Name="Active" Type="Boolean" />
                                    </UpdateParameters>
                                </asp:ObjectDataSource>
                            </ContentTemplate>
                        </asp:TabPanel>
                    </asp:TabContainer>
                </td>
            </tr>
        </table>
        <asp:Button ID="Button7" runat="server" Text="Button" Style="display: none;" />
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="pnlSecondPopoUp"
            DynamicServicePath="" Enabled="True" TargetControlID="btnCloseSecondPopUp" BackgroundCssClass="modalBackground"
            DropShadow="true" CancelControlID="btnCloseSecondPopUp">
        </asp:ModalPopupExtender>
    </asp:Panel>
</asp:Content>
